<!-- 推广商户 -->
<template>
	<view class="container">
		<view class="card">
			<image class="bg" src="../../../static/images/public/bggggg.png" mode=""></image>
			<view>
				<text>{{storeNum}}</text>
				<text>推广商户数量</text>
			</view>
			<image class="qrcode" :src="qrcode" mode=""></image>
		</view>
		<view class="cut"></view>
		<view class="list">
			<view class="item" v-for="(item,index) in list" :key="index" @tap="goDetail(item.seller_id)">
				<view class="top">
					<view class="left">
						<image :src="item.logo" mode=""></image>
						<view>
							<text>{{item.seller_name}}</text>
							<view class="a">
								<text>{{item.province_text}}{{item.city_text}}{{item.area_text}}</text>
							</view>
							<view class="b">
								<text>入驻时间</text>
								<text>{{item.add_time}}</text>
							</view>
						</view>
					</view>
					<view class="right">
						<text>收益总计</text>
						<text>{{item.income}}</text>
					</view>
				</view>
				<view class="bottom">
					<text class="cell-more yticon icon-you"></text>
					<text>每日明细</text>
					<view style="clear: both;"></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		channelSellercount,
		channelSellerlist
	} from "@/api/user.js"
	export default {
		data() {
			return {
				storeNum: "",
				qrcode: "",
				pagesData: {
					page: 1,
					limit: 10,
				},
				list: []
			};
		},
		onLoad(options) {
			channelSellercount().then(res => {
				this.storeNum = res.data.count
				this.qrcode = res.data.qrcode
			})
			this.getList()
		},
		methods: {
			getList() {
				channelSellerlist(this.pagesData).then(res => {
					this.list = res.data.list
				})
			},
			goDetail(id) {
				uni.navigateTo({
					url: "./detail?id=" + id
				})
			}
		}
	};
</script>

<style lang="scss" scoped>
	.container {
		.card {
			display: flex;
			justify-content: space-around;
			align-items: center;
			color: #fff;
			width: 690rpx;
			height: 300rpx;
			background: linear-gradient(0deg, rgba(87, 190, 106, 1) 0%, rgba(143, 224, 158, 1) 100%);
			border-radius: 10rpx;
			margin: 40rpx 30rpx;
			position: relative;

			.bg {
				position: absolute;
				width: 690rpx;
				height: 300rpx;
				left: 0;
				top: 0;
			}

			view {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;

				text:nth-of-type(1) {
					font-size: 46rpx;
					font-weight: bold;
				}

				text:nth-of-type(2) {
					margin-top: 6rpx;
					font-size: 26rpx;
					font-weight: 500;
				}
			}

			.qrcode {
				width: 140rpx;
				height: 140rpx;
				border: 10rpx solid #fff;
				border-radius: 10rpx;
				background-color: #fff;
			}
		}

		.cut {
			height: 20rpx;
			background-color: #eee;
		}

		.list {
			padding: 30rpx;

			.item {
				margin-bottom: 30rpx;
				width: 690rpx;
				border-radius: 10rpx;
				box-shadow: 0px 0px 15rpx 0px rgba(51, 51, 51, 0.15);

				.top {
					padding: 40rpx 30rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;
					border-bottom: 1rpx solid #f5f5f5;

					.left {
						display: flex;

						image {
							background-color: #d4d4d4;
							width: 100rpx;
							height: 100rpx;
							border-radius: 50%;
						}

						>view {
							margin-left: 20rpx;
							height: 100rpx;
							display: flex;
							flex-direction: column;
							justify-content: space-between;

							>text {
								font-size: 24rpx;
								color: rgba(51, 51, 51, 1);
							}

							.a {
								display: inline-block;
								line-height: 20rpx;

								text {
									margin-right: 10rpx;
									font-size: 20rpx;
									color: rgba(153, 153, 153, 1);
								}
							}

							.b {
								display: inline-block;
								line-height: 20rpx;

								text:nth-of-type(1) {
									font-size: 20rpx;
									font-weight: 400;
									color: rgba(51, 51, 51, 1);
									margin-right: 10rpx;
								}

								text:nth-of-type(2) {
									font-size: 20rpx;
									font-weight: 400;
									color: #999999;
									margin-right: 10rpx;
								}

							}
						}
					}

					.right {
						height: 100rpx;
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						align-items: center;

						text:nth-of-type(1) {
							font-size: 24rpx;
							color: rgba(51, 51, 51, 1);
						}

						text:nth-of-type(2) {
							font-size: 34rpx;
							font-weight: bold;
							color: $theme-color;
						}
					}
				}

				.bottom {
					padding:16rpx 30rpx;

					text {
						float: right;
						margin-left: 10rpx;
						font-size: 20rpx;
						color: rgba(153, 153, 153, 1);
						line-height: 40rpx;
					}
				}
			}
		}

	}
</style>
